import 'package:dio/dio.dart';
import 'package:retrofit/retrofit.dart';
import 'package:sonora/config/sj_config.dart';
import 'package:sonora/models/sj_language_translate_body.dart';
import 'package:sonora/models/sj_response_data.dart';
import 'package:sonora/services/sj_api_paths.dart';

part 'sj_api_translate_client.g.dart';

@RestApi(baseUrl: translateHost)
abstract class SjApiTranslateClient {
  factory SjApiTranslateClient(Dio dio, {String baseUrl}) = _SjApiTranslateClient;

  @POST(SjApiPaths.languageTranslateUrl)
  Future<SjResponseData> languageTranslate(@Body() SjLanguageTranslateBody requestBody);

  @GET(SjApiPaths.languageTranslateUrl)
  Future<SjResponseData> languageTranslate2(@Query("key") String key, @Query("target") String target, @Query("q") String q, @Query("format") String format);
}